<?php


namespace App\Validate\Logic;

use App\Exceptions\SysExceptions;
use App\Validate\AdminValidate;

/**
 * Class AdminLogic
 * @package App\Validate\Logic
 * author:fhc
 * desc:后台Logic
 * created_at: {2020/10/16}----10:25 上午
 */
class AdminLogic extends BaseLogic
{
    /**
     * @return AdminValidate
     * author:fhc
     * desc:获取验证器
     * created_at: {2020/10/16}----10:25 上午
     */
    private function getValidate():AdminValidate{
        return  new AdminValidate;
    }

    /**
     * @param array $params
     * author:fhc
     * desc:登录的
     * created_at: {2020/10/16}----10:25 上午
     * @throws SysExceptions
     */
    public function login($params = []){
        $validate = $this->getValidate();
        if(!$validate->scene('login')->check($params)){
            $this->error($validate->getError());
        }
    }
}
